<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Gloze: any</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Gloze
   &#160;<span id="projectnumber">1.01-beta2</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Packages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="components.html">Schema Components</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">any </div>  </div>
</div>
<div class="contents">
<div class="textblock"><p>The use of xs:any makes it necessary to map content for which we have no schema.</p>
<p>The example below includes two marked-up 'parts', and the same content represented as an HTML table. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a href="http://www.w3.org/MarkUp/Group/">http://www.w3.org/MarkUp/Group/</a></dd></dl>
<div class="fragment"><pre class="fragment">&lt;report xmlns=<span class="stringliteral">&quot;http://example.org/&quot;</span>&gt;
  &lt;part&gt;foo&lt;/part&gt;
  &lt;part&gt;bar&lt;/part&gt;
  
  &lt;html xmlns=<span class="stringliteral">&quot;http://www.w3.org/1999/xhtml&quot;</span> xml:<span class="keywordtype">id</span>=<span class="stringliteral">&quot;html&quot;</span>&gt;           
    &lt;table&gt;
      &lt;tr&gt;&lt;td xml:lang=<span class="stringliteral">&quot;en&quot;</span>&gt;foo&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;bar&lt;/td&gt;&lt;/tr&gt;
    &lt;/table&gt;
  &lt;/html&gt;

&lt;/report&gt;
</pre></div><p>The HTML content is here represented by an xs:any element from the 'xhtml' namespace, which may include attributes and arbitrarily nested elements.</p>
<div class="fragment"><pre class="fragment">&lt;xs:schema targetNamespace=<span class="stringliteral">&quot;http://example.org/&quot;</span>
        xmlns:xs=<span class="stringliteral">&quot;http://www.w3.org/2001/XMLSchema&quot;</span> elementFormDefault=<span class="stringliteral">&quot;qualified&quot;</span>&gt;

        &lt;xs:element name=<span class="stringliteral">&quot;report&quot;</span>&gt;
                &lt;xs:complexType&gt;
                        &lt;xs:sequence&gt;
                                &lt;xs:element name=<span class="stringliteral">&quot;part&quot;</span> type=<span class="stringliteral">&quot;xs:string&quot;</span> maxOccurs=<span class="stringliteral">&quot;unbounded&quot;</span>/&gt;
                                &lt;xs:any <span class="keyword">namespace</span>=<span class="stringliteral">&quot;http://www.w3.org/1999/xhtml&quot;</span> processContents=<span class="stringliteral">&quot;skip&quot;</span>/&gt;        
                        &lt;/xs:sequence&gt;
                &lt;/xs:complexType&gt;
        &lt;/xs:element&gt;

&lt;/xs:schema&gt;

</pre></div><p>Not having the schema to hand, <a class="el" href="classcom_1_1hp_1_1gloze_1_1_gloze.html">Gloze</a> regards any content as ambiguously ordered so adds all content to an rdf:Seq. This helps to distinguish attributes from elements; any properties not added to this sequence are therefore attributes. Elements with a single value (and no attributes) are added as literal properties (see 'tr').</p>
<p>The example also includes an xml:id defined to be of type xs:ID, regardless of the schema. This identifies the html resource, and is translated as a fragment identifier relative to the document base.</p>
<div class="fragment"><pre class="fragment">@prefix ns2:     &lt;http:<span class="comment">//example.org/&gt; .</span>
@prefix ns1:     &lt;http:<span class="comment">//example.org/def/&gt; .</span>
@prefix xs_:     &lt;http:<span class="comment">//www.w3.org/2001/XMLSchema#&gt; .</span>
@prefix rdf:     &lt;http:<span class="comment">//www.w3.org/1999/02/22-rdf-syntax-ns#&gt; .</span>
@prefix xs:      &lt;http:<span class="comment">//www.w3.org/2001/XMLSchema&gt; .</span>

&lt;http:<span class="comment">//example.org/any.xml#html&gt;</span>
      &lt;http:<span class="comment">//www.w3.org/1999/xhtml#table&gt;</span>
              [ &lt;http:<span class="comment">//www.w3.org/1999/xhtml#tr&gt;</span>
                        [ &lt;http:<span class="comment">//www.w3.org/1999/xhtml#td&gt;</span>
                                  [ rdf:value <span class="stringliteral">&quot;foo&quot;</span>@en
                                  ]
                        ] ;
                &lt;http:<span class="comment">//www.w3.org/1999/xhtml#tr&gt;</span>
                        [ &lt;http:<span class="comment">//www.w3.org/1999/xhtml#td&gt;</span>
                                  <span class="stringliteral">&quot;bar&quot;</span>
                        ]
              ] .

&lt;http:<span class="comment">//example.org/any.xml&gt;</span>
      ns2:report
              [ ns2:part <span class="stringliteral">&quot;foo&quot;</span>^^xs_:string , <span class="stringliteral">&quot;bar&quot;</span>^^xs_:string ;
                &lt;http:<span class="comment">//www.w3.org/1999/xhtml#html&gt;</span>
                        &lt;http:<span class="comment">//example.org/any.xml#html&gt;</span>
              ] .
</pre></div><p>If a schema is available for the wild-card element, then it may be referenced from within the XML instance document using an xsi:schemaLocation or xsi:noNamespaceSchemaLocation attribute. This can appear in the document element or on the wild-card element itself. </p>
</div></div>


<hr class="footer"/><address class="footer"><small>
Generated on Tue Nov 15 2011 22:13:50 for Gloze by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
